
#ifndef _LoginCommandIn_H_
#define _LoginCommandIn_H_

#include "command.h"

#pragma pack(1)

namespace Cmd
{
        namespace Login
        {
                enum {
                        CMDIN_LOGIN             = 0x0010,
                        CMDIN_GATEWAY           = 0x0011,
                };

                // CMDIN_LOGIN
                enum {
                        SCMDIN_LOGIN                            = 0x0001,       // 请求登录LoginServer
                        SCMDIN_LOGIN_RESPONCE                   = 0x0002,       // 登录LoginServer返回
                };
                // CMDIN_GATEWAY
                enum {
                        SCMDIN_GATEWAY_WAIT_USER_REQ_old        = 0x0001,
                        SCMDIN_GATEWAY_WAIT_USER_RES_old        = 0x0002,
                        SCMDIN_GATEWAY_WAIT_USER_REQ            = 0x0003,
                        SCMDIN_GATEWAY_WAIT_USER_RES            = 0x0004,
                };


                // login cmd
                struct stLoginCmd : t_NullCmd
                {
                        stLoginCmd()
                                : t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                dest_type_ = LOGINSERVER;
                                server_type_ = 0;
                                server_id_ = 0;
                        }

                        WORD dest_type_;
                        WORD server_type_;
                        DWORD server_id_;
                };

                struct stLoginResponce : t_NullCmd
                {
                        stLoginResponce()
                                : t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                // gateway cmd
                struct stGatewayWaitUserReq_old : t_NullCmd
                {
                        stGatewayWaitUserReq_old()
                                : t_NullCmd(CMDIN_GATEWAY, SCMDIN_GATEWAY_WAIT_USER_REQ_old)
                        {
                                temp_id_ = 0;
                                user_id_ = 0;
                                token_ = 0;
                        }

                        DWORD temp_id_;
                        DWORD user_id_;
                        DWORD token_;
                };

                struct stGatewayWaitUserRes_old : t_NullCmd
                {
                        stGatewayWaitUserRes_old()
                                : t_NullCmd(CMDIN_GATEWAY, SCMDIN_GATEWAY_WAIT_USER_RES_old)
                        {
                                temp_id_ = 0;
                                user_id_ = 0;
                                token_ = 0;
                                ret_code_ = 0;
                        }

                        DWORD temp_id_;
                        DWORD user_id_;
                        DWORD token_;
                        BYTE ret_code_;         // 0-ok, 1-fail
                };

                struct stGatewayWaitUserReq : t_NullCmd
                {
                        stGatewayWaitUserReq()
                                : t_NullCmd(CMDIN_GATEWAY, SCMDIN_GATEWAY_WAIT_USER_REQ)
                        {
                                temp_id_ = 0;
                                user_type_ = 0;
                                user_id_ = 0;
                                token_ = 0;
                        }

                        uint32_t temp_id_;
                        uint8_t user_type_;
                        uint32_t user_id_;
                        uint32_t token_;
                };

                struct stGatewayWaitUserRes : t_NullCmd
                {
                        stGatewayWaitUserRes()
                                : t_NullCmd(CMDIN_GATEWAY, SCMDIN_GATEWAY_WAIT_USER_RES)
                        {
                                temp_id_ = 0;
                                user_id_ = 0;
                                user_type_ = 0;
                                token_ = 0;
                                ret_code_ = 0;
                        }

                        uint32_t temp_id_;
                        uint32_t user_id_;
                        uint8_t user_type_;
                        uint32_t token_;
                        uint8_t ret_code_;         // 0-ok, 1-fail
                };

        };      // namespace Login
};      // namespace Cmd

#pragma pack() //pack(1)

#endif  // _LoginCommandIn_H_
